//
// Created by liushuai on 12/29/19.
//
#include "reverseLinkListRec.hpp"
ListNode* reverseLinkListRec(ListNode* head)
{
    if (head == nullptr || head->next == nullptr)
        return head;
    ListNode* tail = reverseLinkListRec(head->next);
    head->next->next = head;
    head->next = nullptr;
    return tail;
};
